//
//  Color.m
//  OC6_作业练习COLOR
//
//  Created by dllo on 15/11/1.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Color.h"

@implementation Color
@synthesize colorName = _colorName;
@synthesize colorValue = _colorValue;


- (NSString *)colorName
{
    return [[_colorName retain] autorelease];
}

- (void)setColorName:(NSString *)colorName
{
    if (_colorName != colorName) {
        [_colorName release];
        _colorName = [colorName copy];
    }
}

- (NSString *)colorValue
{
    return [[_colorValue retain] autorelease];
}

- (void)setColorValue:(NSString *)colorValue
{
    if (colorValue != _colorValue) {
        [_colorValue release];
        _colorValue = [colorValue copy];
    }
}


- (id)initWithColorName:(NSString *)colorName colorValue:(NSString *)colorValue
{
    self = [super init];
    if (self) {
        [self setColorName:colorName];
        [self setColorValue:colorValue];
    }
    return self;
}


@end
